export const rangeValidator = () => ({
  validator(_, value) {
    const num = Number(value);
    if (isNaN(num)) {
      return Promise.reject('必须输入有效数字');
    }
    console.log(value)
    if (/^-?\d+(\.\d{1,2})?$/.test(value) && Number(value) >= 0 && Number(value) <= 99999999 ||
        value === '' || value === null) {
      return Promise.resolve();
    }else{
      return Promise.reject(`[0,99999999]，2位小数`);
    }
  }
});
